﻿<Window  x:Class="LoadCalc.MainWindow" 
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:LoadCalc"
        Title="MainWindow" Height="600" Width="800">
    <Window.Resources>
        <DataTemplate x:Key="MenuItemDataTemplate" >
            <TextBox Text="{Binding Title}" />
        </DataTemplate>
    </Window.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="34*"/>
            <RowDefinition Height="400*"/>
            <RowDefinition Height="200*"/>
            <RowDefinition Height="142*"/>
        </Grid.RowDefinitions>
        <Menu HorizontalAlignment="Stretch"  Height="Auto" Margin="0,0,0,0" VerticalAlignment="Top" >
            <MenuItem Header="File" Margin="0"/>
            <MenuItem Header="Help" Margin="0"/>
            <MenuItem Header="About" Margin="0" Click="About_Click_1"/>
            <MenuItem Header="Windows" Margin="0" Name="menuWindows"  />
        </Menu>
        <StatusBar Name="StatusBar" HorizontalAlignment="Stretch" Height="Auto" VerticalAlignment="Bottom" Grid.Row="3" TextBlock.TextAlignment="Left">
            <Label  Name="Status" Content="" Width="Auto" Height="Auto" Margin="0,0,0,0" BorderThickness="0" VerticalAlignment="Top"/>
        </StatusBar>
        <Grid HorizontalAlignment="Stretch" Margin="5,0,0,0" Grid.Row="1" VerticalAlignment="Stretch"  Grid.RowSpan="1" >
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="1*"/>
                <ColumnDefinition Width="3*"/>
            </Grid.ColumnDefinitions>
            <StackPanel>
            <Grid HorizontalAlignment="Stretch" Margin="0,0,10,0">
                <Grid.RowDefinitions>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="*"/>
                    <RowDefinition Height="*"/>
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="1*"/>
                    <ColumnDefinition Width="1*"/>
                </Grid.ColumnDefinitions>
                <Label Content="Units" Height="Auto" Grid.Row="0" Grid.Column="0"/>
                <ComboBox Height="Auto" x:Name="UOMSelector"  Grid.Row="0" Grid.Column="1" Margin="0,0,0,10">
                    <ComboBoxItem Selector.IsSelected="True" Content="Imperial (Pound/Foot/Gallon)"/>
                    <ComboBoxItem Content="Metric (Kgm/Meter/Liter)"/>
                </ComboBox>
                <Label Content="Empty truck" Height="Auto"  Grid.Row="1" Grid.Column="0"/>
                    <TextBox TextWrapping="NoWrap" x:Name="EmptyTruckWeight" Text="" Height="Auto" MaxLength="5"  Grid.Row="1" Grid.Column="1"  Margin="0,0,0,10"/>
                <Label Content="Empty trailer" Height="Auto" Grid.Row="2" Grid.Column="0"/>
                    <TextBox TextWrapping="NoWrap"  x:Name="EmptyTrailerWeight" Text="" Height="Auto" MaxLength="5"  Grid.Row="2" Grid.Column="1" Margin="0,0,0,10"/>
                <Label Content="Fuel" Height="Auto" Grid.Row="3" Grid.Column="0"/>
                    <TextBox TextWrapping="NoWrap" x:Name="FuelWeight" Text="" Height="Auto" MaxLength="4"  Grid.Row="3" Grid.Column="1" Margin="0,0,0,10"/>
                <Label Content="Wheelbase" Height="Auto" Grid.Row="4" Grid.Column="0"/>
                    <TextBox TextWrapping="NoWrap" x:Name="WheelBase"  Text="" Height="Auto" MaxLength="3"  Grid.Row="4" Grid.Column="1" Margin="0,0,0,10"/>
                    <Button Content="Calculate" Height="Auto" Click="Button_Click_1"  Grid.Row="5" Grid.Column="0" Grid.ColumnSpan="2" VerticalContentAlignment="Center"  Margin="0,0,0,10"/>
            </Grid>
            </StackPanel>
            <GridSplitter Width="5"></GridSplitter>
            <DataGrid HorizontalAlignment="Stretch" Margin="0,0,0,0" VerticalAlignment="Stretch" Grid.Row="0" Grid.Column="1"
                      Name="LoadList" EnableColumnVirtualization="True" AlternatingRowBackground="LightGray" AutoGenerateColumns="False">
                <DataGrid.Columns>
                    <DataGridTextColumn  Binding="{Binding Path=Order}" Header="Order" Width="1*"/>
                    <DataGridTextColumn  Binding="{Binding Path=Weight}"  Header="Weight" Width="2*" />
                    <DataGridTextColumn  Binding="{Binding Path=Location}"  Header="Location"  Width="2*"/>
                    <DataGridTextColumn  Binding="{Binding Path=Length}"  Header="Length" Width="2*"/>
                    <DataGridTextColumn  Binding="{Binding Path=Notes}"  Header="Notes" Width="4*"/>
                </DataGrid.Columns>
            </DataGrid>
        </Grid>
        <WrapPanel HorizontalAlignment="Left" Height="108" Margin="10,19,0,0" Grid.Row="2" VerticalAlignment="Top" Width="772">
            <Label Content="Truck Front"/>
            <TextBox x:Name="TruckFront" Height="Auto" TextWrapping="Wrap" Text="" Width="120" IsReadOnly="True"/>
            <Label Content="Trailer Front"/>
            <TextBox x:Name="TrailerFront" Height="Auto" TextWrapping="Wrap" Text="" Width="120" IsReadOnly="True"/>
            <Label Content="Trailer Back"/>
            <TextBox  x:Name="TrailerBack" Height="Auto" TextWrapping="Wrap" Text="" Width="120" IsReadOnly="True"/>
        </WrapPanel>
    </Grid>

</Window>
